<!--
 * @author hjj
 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试页面</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"/>
    <!--    <link rel="stylesheet" href="./element-ui/theme-chalk/index.css" />-->
</head>
<body>
<div id="app">

<!--    <el-upload-->
<!--            class="avatar-uploader"-->
<!--            ref="upload"-->
<!--            :headers="{'token':tokens}"-->
<!--            :action=path+"/users/image"-->
<!--            :show-file-list="false"-->
<!--            :on-error="onerror"-->
<!--            :on-success="onsuccess"-->
<!--            :limit="1">-->
<!--        <img v-if="imageUrl" :src="imageUrl" class="avatar">-->
<!--        <i v-else class="el-icon-plus avatar-uploader-icon"></i>-->
<!--        <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>-->
<!--    </el-upload>-->

<!--    <el-upload-->
<!--            action="#"-->
<!--            list-type="picture-card"-->
<!--            :on-change="changeFile"-->
<!--            :auto-upload="false"-->
<!--            :file-list="fileList">-->
<!--        <i slot="default" class="el-icon-plus"></i>-->
<!--    </el-upload>-->
    <template>
        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    prop=""
                    label="课次/日期"
                    width="80">
                <template slot-scope="scope">
                    {{ scope.row.name }} <br>
                    {{ scope.row.name }} <br>
                    {{ scope.row.name }}
                </template>
            </el-table-column>

            <el-table-column
                    prop="monday"
                    label="周一">
                <template slot-scope="scope">
                    <div v-if="scope.row.state===0"> </div>
                    <div v-else-if="scope.row.state===2">
                        {{ scope.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周二">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周三">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周四">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周五">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周六">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                    label="周日">
                <template slot-scope="scope">
                    <div v-if="scope.monday.row.state===0"> </div>
                    <div v-else-if="scope.monday.row.state===2">
                        {{ scope.monday.row.courseName}} <br>
                        [非本周课程]
                    </div>
                    <div v-else>
                        {{ scope.monday.row.courseName}} <br>
                        @:{{ scope.monday.row.courseTeacherName}} <br>
                        {{ scope.monday.row.skip==1?'单周':'双周'}}<br>
                        ({{scope.monday.row.remake}})
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </template>

    <el-button @click="test">点我</el-button>
</div>
<!--导入axios-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>
<!--<script src="./axios/axios.min.js"></script>-->
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
<!--<script src="./vue/vue.js"></script>-->

<!-- import ElementJavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<!--<script src="./element-ui/index.js"></script>-->
<script>
    new Vue({
        el: "#app",
        methods: {
            //更新图片列表
            changeFile(file, fileList){
                this.fileList=fileList;
            },
            // test(){
            //     axios({
            //         headers:{
            //             'token':this.tokens
            //         },
            //         method: 'put',
            //         params:{
            //             username:'jsy',
            //             name:'教师乙',
            //             sex:'女',
            //             remake:'无',
            //             taste:JSON.stringify(this.taste)
            //         },
            //         url: this.path+'/users/update'
            //         // data:this.fileList
            //     }).then(resp=>{
            //         if(resp.data.code===1){
            //             this.$message.success("创建成功");
            //         }else{
            //             this.$message.error(resp.data.msg);
            //         }
            //     })
            // }
            test(){

            }
        },
        data() {
            return {
                fileList:[],
                taste:["其他","财税教育"],
                path:"http://192.168.0.103:8085",
                tokens:'',
                imageUrl:'',
                culWeekly:'',
                name:'',
                tableData:{
                    culWeekly:'',
                    userNicName:'',
                    timeTables:[],
                    thursday:[],
                    wednesday:[],
                    monday:[],
                    saturday:[],
                    tuesday:[],
                    friday:[],
                    sunday:[]
                },
            }
        },
        created(){
            //简单登录
            axios.get(this.path+'/users/login?username=zhangl&password=zl&type=1').then(resp=>{
                if(resp.data.code===1){
                    this.tokens=resp.data.data.token;
                    this.imageUrl=resp.data.data.imageUrl;
                    axios({
                        headers:{
                            'token':resp.data.data.token
                        },
                        method: 'get',
                        url: this.path+'/detes/selfSchedule'
                    }).then(resp2=>{
                        if(resp2.data.code===1){
                            this.tableData=resp2.data.data;
                        }else{
                            this.$message.error(resp2.data.msg);
                        }
                    })
                }
            })
        }
    })
</script>
</body>
</html>